/**
 * @description: 教程链接：https://stylelint.io/
 * @author: liejiayong(809206619@qq.com)
 * @Date: 2022-10-25 16:56:39
 *
 * pnpm install -D stylelint stylelint-config-html stylelint-config-recess-order stylelint-config-standard-scss stylelint-config-standard-vue stylelint-prettier
 */
export default {
	extends: [
		"stylelint-config-recess-order", //配置stylelint css属性书写顺序插件
		"stylelint-config-standard-scss",
		"stylelint-config-standard-vue/scss", //继承 Stylelint 中推荐的适合于 vue 中 scss 样式格式化的配置
		"stylelint-config-standard-vue", //https://github.com/ota-meshi/stylelint-config-standard-vue
		"stylelint-config-html/vue", //继承 Stylelint 中适合于 vue 中 template 样式格式化的配置
		"stylelint-prettier/recommended",
	],
	rules: {
		"font-family-no-missing-generic-family-keyword": null,
		"value-keyword-case": null, // 在 css 中使用 v-bind，不报错
		"no-descending-specificity": null, // 禁止在具有较高优先级的选择器后出现被其覆盖的较低优先级的选择器
		"function-url-quotes": "always", // 要求或禁止 URL 的引号 "always(必须加上引号)"|"never(没有引号)"
		"selector-class-pattern": "^([a-z0-9]+[A-Z]*)((-|_){0,2}[a-z0-9]+[A-Z]*)*$", // 关闭强制选择器类名的格式
		"property-no-unknown": null, // 禁止未知的属性(true 为不允许)
		"value-no-vendor-prefix": null, // 关闭 属性值前缀 --webkit-box
		"property-no-vendor-prefix": null, // 关闭 属性前缀 -webkit-mask
		"selector-pseudo-class-no-unknown": [
			// 不允许未知的选择器
			true,
			{
				ignorePseudoClasses: ["global", "v-deep", "deep"], // 忽略属性，修改element默认样式的时候能使用到
			},
		],
		"at-rule-no-unknown": null,
		"media-feature-name-no-unknown": null,
		"no-empty-source": null,
		"max-nesting-depth": 3,
		"selector-max-compound-selectors": 5,
		"selector-no-vendor-prefix": [
			true,
			{
				ignoreSelectors: ["/-webkit-.*/", "/-moz-.*/"],
			},
		],
	},
	overrides: [
		{
			files: ["**/*.(scss|css|vue|html)"],
			customSyntax: "postcss-scss",
		},
		{
			files: ["**/*.(html|vue)"],
			customSyntax: "postcss-html",
		},
	],
	ignoreFiles: [
		"**/*.min.css",
		"**/*.js",
		"**/*.jsx",
		"**/*.tsx",
		"**/*.ts",
		"**/*.json",
		"**/*.md",
		"**/*.yaml",
		"/node_modules/*",
		"/dist/*",
		"/public/*",
	],
};
